package com.easy.frame.common.process.core.emum;

import com.easy.frame.base.basic.enums.BaseEnum;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 操作类型枚举
 *
 * @author zzf
 * @date 2021/2/26 14:26
 */
@Getter
@AllArgsConstructor
public enum OperationTypeEnum implements BaseEnum {

    PASS(1, "通过"),
    REJECT(2, "驳回"),
    ROLLBACK(3, "回退");

    private final int key;

    private final String value;

    public static OperationTypeEnum getByKey(Long id) {
        for (OperationTypeEnum compareTypeEnum : OperationTypeEnum.values()) {
            if (compareTypeEnum.getKey() == id) {
                return compareTypeEnum;
            }
        }
        return null;
    }
}
